package com.my.kq.controller;

import com.my.kq.entity.Overtime;
import com.my.kq.service.overtimeService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.util.List;


//加班信息
public class overtimeList extends HttpServlet {
    private overtimeService overtimeService=new overtimeService();
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        try {
            List<Overtime> list= overtimeService.overList();

            HttpSession session = req.getSession();
            session.setAttribute("over",list);

            req.getRequestDispatcher("jsp/admin/overtime_list.jsp").forward(req,resp);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doGet(req, resp);
    }
}
